package com.llho.core.domain;

import java.util.List;

public class Catalog {
	private Long id;
	private String name;
	private Catalog parent;
	private List<Catalog> children;
	private List<Product> products;
	
	public Catalog(){}
	
	public Catalog(String name, Catalog parent, List<Catalog> children,
			List<Product> products) {
		super();
		this.name = name;
		this.parent = parent;
		this.children = children;
		this.products = products;
	}
	
	public void addProduct(Product product){
		product.setCatalog(this);
		this.products.add(product);
	}
	
	public void addChildCatalog(Catalog catalog){
		catalog.setParent(this);
		this.children.add(catalog);
	}

	public Long getId() {
		return id;
	}
	public void setId(Long id) {
		this.id = id;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public Catalog getParent() {
		return parent;
	}
	public void setParent(Catalog parent) {
		this.parent = parent;
	}

	public List<Catalog> getChildren() {
		return children;
	}

	public void setChildren(List<Catalog> children) {
		this.children = children;
	}

	public List<Product> getProducts() {
		return products;
	}

	public void setProducts(List<Product> products) {
		this.products = products;
	}
	
}
